package com.hejjon.domain.vo;

import cn.hutool.core.lang.Pair;
import com.hejjon.core.domain.vo.RecordRelTableInfoVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;

@Data
public class FeaturePublishDetailVO {

    @ApiModelProperty(value = "发布记录ID")
    private String recordId;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @ApiModelProperty(value = "发布名称")
    private String publishName;


    @ApiModelProperty(value = "关联特征名称(多个以,分隔)")
    private String featureNames;

    @ApiModelProperty(value = "关联特征显示名称(多个以,分隔)")
    private String featureLabels;

    @ApiModelProperty(value = "数据库名称")
    private String databaseName;

    @ApiModelProperty(value = "发布状态名称")
    private String statusName;

    @ApiModelProperty(value = "描述信息")
    private String description;

    @ApiModelProperty(value = "发布表名称(多个以,分隔)")
    private String tableNames;

    @ApiModelProperty(value = "特征名称列表")
    private List<String> featureNameList;

    @ApiModelProperty(value = "特征显示名称列表")
    private List<String> featureLabelList;

    @ApiModelProperty(value = "发布表名称列表")
    private List<String> tableNameList;


    public static List<Pair<Function<FeaturePublishDetailVO, List<String>>, BiConsumer<FeaturePublishDetailVO, String>>> convertors() {
        List<Pair<Function<FeaturePublishDetailVO, List<String>>, BiConsumer<FeaturePublishDetailVO, String>>> convertors = new ArrayList<>();
        convertors.add(Pair.of(FeaturePublishDetailVO::getFeatureLabelList, FeaturePublishDetailVO::setFeatureLabels));
        convertors.add(Pair.of(FeaturePublishDetailVO::getFeatureNameList, FeaturePublishDetailVO::setFeatureNames));
        convertors.add(Pair.of(FeaturePublishDetailVO::getTableNameList, FeaturePublishDetailVO::setTableNames));
        return convertors;
    }

}
